using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace IUPUI.StellarResults.Client
{
	/// <summary>
	/// A form that displays information about the application.
	/// </summary>
	public partial class AboutForm : Form
	{
		#region Constructors
		/// <summary>
		/// Initializes a new instance of the <see cref="AboutForm"/> class.
		/// </summary>
		public AboutForm()
		{
			InitializeComponent();	
		}
		#endregion Constructors

		/// <summary>
		/// Raises the <see cref="E:System.Windows.Forms.Form.Load"/> event.
		/// </summary>
		/// <param name="e">An <see cref="T:System.EventArgs"/> that contains the event data.</param>
		protected override void OnLoad(EventArgs e)
		{
			// Populate data from assembly.info
			ININ.Reflection.AssemblyInfoWrapper assemblyInfoWrapper =
				new ININ.Reflection.AssemblyInfoWrapper(System.Reflection.Assembly.GetExecutingAssembly());

			m_ProductNameLabel.Text = assemblyInfoWrapper.Product;
			m_VersionLabel.Text = String.Format(
				Properties.Resources.ApplicationVersionLabel, 
				assemblyInfoWrapper.Version.ToString());
			m_CopyrightLabel.Text = assemblyInfoWrapper.Copyright;
			m_UrlLinkLabel.Text = Properties.Resources.ProjectUrl;

			base.OnLoad(e);
		}

		/// <summary>
		/// Handles the LinkClicked event of the m_UrlLinkLabel control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="System.Windows.Forms.LinkLabelLinkClickedEventArgs"/> instance containing the event data.</param>
		private void m_UrlLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
		{
			System.Diagnostics.Process.Start(Properties.Resources.ProjectUrl);
		}
	}
}